const LS: any = window.localStorage
export default {
  get(key: string) {
    let data: any = null
    try {
      data = JSON.parse(LS.getItem(key))
    } catch (e) {
      console.error('json 解析错误')
    }
    return data
  },
  set(key: string, value: any) {
    return LS.setItem(key, JSON.stringify(value))
  },
  remove(key: string) {
    LS.removeItem(key)
  }
}
